{% extends "admin/base.html" %}
{% load i18n %}

{% block content %}
<form action="{{ form.action }}" method="post">{% csrf_token %}
    <input onClick="history.back()" type="button" value="{% trans 'Back' %}" />
    <input type="submit" name="2select" value="{% trans 'Change selection' %}" />
    <input type="submit" name="2outgoing" value="{% trans 'Outgoing (same selection)' %}" />
    <input type="submit" name="2process" value="{% trans 'Process Errors (same selection)' %}" />
    <input type="submit" name="2confirm" value="{% trans 'Confirm (same selection)' %}" />
    {% include "bots/paginator.html" %}

    <table id="botstable">
        {% for hidden in form.hidden_fields %}
            {{ hidden }}
        {% endfor %}
        <thead>
            <tr>
                <th></th>
                <th><button class="botsheader" type="submit" name="order" value="status" />{% trans 'State' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="retransmit" />{% trans 'Re*' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="idroute" />{% trans 'Route' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="ts" />{% trans 'Date/time' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="nrmessages" />{% trans '#in' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="ineditype" />{% trans 'InEditype' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="inmessagetype" />{% trans 'InMessagetype' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="fromchannel" />{% trans 'FromChannel' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="frompartner" />{% trans 'FromPartner' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="tochannel" />{% trans 'ToChannel' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="topartner" />{% trans 'ToPartner' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="outeditype" />{% trans 'OutEditype' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="outmessagetype" />{% trans 'OutMessagetype' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="infilename" />{% trans 'InFile' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="outfilename" />{% trans 'OutFile' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="errortext" />{% trans 'Error' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="divtext" />{% trans 'MappingScript' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="frommail" />{% trans 'FromMail' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="tomail" />{% trans 'ToMail' %}</button></th>
            </tr>
        </thead>
        <tbody>
        {% for row in queryset.object_list %}
            <tr class="{% cycle 'row1' 'row2' %}">
                <td>
                    <div class="dropdown"><img class="action" src="/media/images/star.png" />
                        <ul>
                            <li><a href="/detail/?inidta={{row.idta}}" class="botslink" target="_blank">{% trans 'View detail' %}</a></li>
                            <li><button class="botsheader" type="submit" name="retransmit" value="{{row.idta}}-{{row.reportidta}}" />{% trans 'Rerecieve' %}</button></li>
                        </ul>
                    </div>
                </td>
                <td>{{ row.get_statust_display}}</td>
                <td><input disabled="True" type="checkbox" {% if row.retransmit %}checked{% endif %}/></td>
                <td>{{row.idroute}}</td>
                <td class="nowrap">{{row.ts|date:"Y-m-d H:i:s" }}</td>
                <td>{{row.nrmessages}}</td>
                <td>{{row.ineditype}}</td>
                <td>{{row.inmessagetype}}</td>
                <td>{{row.fromchannel}}</td>
                <td>{{row.frompartner}}</td>
                <td>{{row.tochannel}}</td>
                <td>{{row.topartner}}</td>
                <td>{{row.outeditype}}</td>
                <td>{{row.outmessagetype}}</td>
                <td><a href="/filer/?action=this&amp;idta={{row.idta}}" target="_blank" class="botslink">{{row.infilename}}</a></td>
                <td><a href="/filer/?action=this&amp;idta={{row.outidta}}" target="_blank" class="botslink">{{row.outfilename}}</a></td>
                <td style="white-space: pre;">{{row.errortext}}</td>
                <td>{{row.divtext}}</td>
                <td>{{row.frommail}}</td>
                <td>{{row.tomail}}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
</form>
{% endblock %}

